package day05;

public class PeopleBean {
    public String name;
    private int age;
    private String gender;

    public void setAge(int a) {
        if(a>=18&&a<35) age=a;
        else System.out.println("非法数据");
    }
    public int getAge() {
        return age;
    }
    public void setGender(String g) {
        if(g.equals("M")) gender="M";
        else if(g.equals("F")) gender="F";
        else System.out.println("非法");
    }
    public String getGender() {
        return gender;
    }


}
